﻿#pragma once

#include "../MirEnvir/Envir.h"
#include <string>
#include <vector>
#include "../../stringhelper.h"

using namespace Server::MirEnvir;

namespace Server::MirDatabase
{
    class NPCInfo
    {
    public:
        virtual ~NPCInfo()
        {
            delete Location;
            delete Colour;
        }

    protected:
        static Envir *getEditEnvir();

    public:
        int Index = 0;

        std::string FileName = std::string::Empty, Name = std::string::Empty;

        int MapIndex = 0;
        Point *Location;
        unsigned short Rate = 100;
        unsigned short Image = 0;
        Color *Colour;

        bool TimeVisible = false;
        unsigned char HourStart = 0;
        unsigned char MinuteStart = 0;
        unsigned char HourEnd = 0;
        unsigned char MinuteEnd = 1;
        short MinLev = 0;
        short MaxLev = 0;
        std::string DayofWeek = "";
        std::string ClassRequired = "";
        bool Sabuk = false;
        int FlagNeeded = 0;
        int Conquest = 0;

        std::vector<int> CollectQuestIndexes = std::vector<int>();
        std::vector<int> FinishQuestIndexes = std::vector<int>();

        NPCInfo();
        NPCInfo(BinaryReader *reader);
        void Save(BinaryWriter *writer);

        static void FromText(const std::string &text);
        std::string ToText();

        std::string ToString();
    };
}
